@extends('admin.layout.layout', ['row' => @$page])
@section('style')
    <style>
        .table .tth{
            background-color: rgba(0, 0, 0, 0.05);
            width: 150px;
            font-weight: bold;
        }
        .table .ttd{
            width: 350px;
        }
        .table .ttt{
            padding: 0;
        }
        .ttt .table{
            margin: 0;
        }
        .ttt .table img + p{
            text-align: center;
            margin: 10px 0 0;
        }
        .tst{
            color: #00b050;
            font-weight: 700;
            text-align: center;
            font-size: 1.25rem;
        }
    </style>
@endsection
@section('contain')


    <div class="portlet">
        <div class="portlet-title">
            <div class="caption">
                <x-portlet-breadcrumb :page="$page"></x-portlet-breadcrumb>
            </div>
            <div class="actions">
                {{--<div class="item">
                    <a href="/{{ request()->path() }}/create" class="btn btn-sm btn-primary">{{ ts('addnew') }}</a>
                </div>--}}
            </div>
        </div>

        <div>
            <table class="table s3">
                <tbody>
                <tr>
                    <td class="tth">{{ ts('warrantyid') }}</td>
                    <td class="ttd" colspan="5">{{ $data->warranty_id }}</td>
                </tr>
                <tr>
                    <td colspan="6" class="tst">{{ ts('CAROWNERINFORMATION') }}</td>
                </tr>
                <tr>
                    <td class="tth">{{ ts('CUSTOMERNAME') }}</td>
                    <td class="ttd">{{ $data->first_name }}</td>
                    <td class="tth">{{ ts('phonenumber') }}</td>
                    <td class="ttd">{{ $data->extension }} {{ $data->phone_number }}</td>
                    <td class="tth">{{ ts('email') }}</td>
                    <td class="ttd">{{ $data->email_address }}</td>
                </tr>
                <tr>
                    <td class="tth">{{ ts('region') }}</td>
                    <td>{{ ts('region_master.'.$data->region_id) }}</td>
                    <td class="tth">{{ ts('province') }}</td>
                    <td>{{ ts('province_master.'.$data->province_id) }}</td>
                    <td class="tth">{{ ts('city') }}</td>
                    <td>{{ ts('cities.'.$data->city) }}</td>
                </tr>
                <tr>
                    <td class="tth">{{ ts('CZDZ') }}</td>
                    <td colspan="3">{{ $data->address }}</td>
                    <td class="tth"></td>
                    <td></td>
                    {{--<td class="tth">{{ ts('zip') }}</td>
                    <td>{{ $data->zip }}</td>--}}
                </tr>
                <tr>
                    <td colspan="6" class="tst">{{ ts('VEHICLEINFORMATION') }}</td>
                </tr>
                <tr>
                    <td class="tth">{{ ts('clnf') }}</td>
                    <td>{{ $data->year_id }}</td>
                    <td class="tth">{{ ts('make') }}</td>
                    <td>{{ ts('make_master.'.$data->make_id) }}</td>
                    <td class="tth">{{ ts('model') }}</td>
                    <td>
                        {{ ts('model_master.'.$data->model_id) ?: $data->model_id }}
                    </td>
                </tr>
                <tr>
                    <td class="tth">{{ ts('licenseplate') }}</td>
                    <td>{{ $data->license_plate }}</td>
                    <td class="tth">{{ ts('vinnumber') }}</td>
                    <td colspan="3">{{ $data->vin_number }}</td>
                </tr>
                <tr>
                    <td colspan="6" class="tst">{{ ts('INSTALLATIONINFORMATION') }}</td>
                </tr>
                <tr>
                    <td class="tth">{{ ts('qudao') }}</td>
                    <td colspan="5">
                        {{ getWDName($data) }}
                        {{--{{ getJc($data->user_id) }}--}}
                    </td>
                </tr>
                <tr>
                    <td class="tth">{{ ts('INSTALLERNAME') }}</td>
                    <td>{{ $data->installer_name }}</td>
                    <td class="tth">{{ ts('INSTALLATIONDATE') }}</td>
                    <td>
                        {{ fdate(@$data->installation_date) }}
                    </td>
                    <td class="tth">{{ ts('INSTALLERPRICE') }}</td>
                    <td>{{ $data->installation_price }}</td>
                </tr>
                <tr>
                    <td colspan="6" class="tst">{{ ts('INSTALLATIONPICTURE') }}</td>
                </tr>
                <tr>
                    <td colspan="6" class="ttt">
                        <x-warranty-image :warranty="$data"></x-warranty-image>
                        {{--@include('admin.subview.aztp-tb')--}}
                    </td>
                </tr>
                {{--<tr>
                    <td colspan="6" class="ttt">
                        <x-warranty-image-demo></x-warranty-image-demo>
                    </td>
                </tr>--}}
                <tr>
                    <td colspan="6" class="tst">{{ ts('VEHICLECOVERAGE') }}</td>
                </tr>
                <tr>
                    <td colspan="6" class="ttt">
                        @include('admin.subview.coverage-tb', ['coverages'=>$data->warranty_to_vehicle_coverage])
                    </td>
                </tr>
                <tr>
                    <td colspan="6" class="tst">{{ ts('BCSM') }}</td>
                </tr>
                <tr>
                    <td colspan="6" height="64">{{ $data->additional_comments }}</td>
                </tr>
                </tbody>
            </table>

            <div class="mt-4">
                @if(session('admin.user_type')==1)
                @else
                    @if($data->approved==3)
                        <a class="btn btn-warning" href="/{{ request()->path() }}/{{ $data->id }}/edit">{{ ts('edit') }}</a>
                        <span class="btn btn-primary" onclick="handleWFQSH({{ $data->id }})">{{ ts('FQSH') }}</span>
                    @elseif($data->approved==2)
                        <span class="btn btn-danger btn-sm" onclick="handleDelete({{ $data->id }})">{{ ts('delete') }}</span>
                    @endif
                @endif
            </div>
        </div>


    </div>


@endsection